package com.wquick.base.utils

import android.os.Bundle
import android.view.View
import android.view.accessibility.AccessibilityEvent
import android.view.accessibility.AccessibilityNodeInfo

class ForbidAccessibilityDelegate : View.AccessibilityDelegate() {

    override fun performAccessibilityAction(host: View, action: Int, args: Bundle?): Boolean {
        if (AccessibilityNodeInfo.ACTION_CLICK == action || AccessibilityNodeInfo.ACTION_LONG_CLICK == action) {
            return true
        }
        return super.performAccessibilityAction(host, action, args)
    }

    override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfo) {

    }

    override fun onInitializeAccessibilityEvent(host: View, event: AccessibilityEvent) {
        super.onInitializeAccessibilityEvent(host, event)
    }

    override fun sendAccessibilityEvent(host: View, eventType: Int) {
        super.sendAccessibilityEvent(host, eventType)
    }

}